var app={
	id:'id',
	data:{},
	bindNodeData:{}, //数据绑定函数 字段key，与key绑定的节点列表
	documets:[],
	vfor:{},//保存含有v-for标签包裹的子节点，vfor在运行过程中保存的数据
	//所有节点下所有的子节点，也包括子节点的子节点
	getAllChildNodes:function(node){
		const childNodes = Array.from(node.childNodes);
		const allChildNodes = [];
		  childNodes.forEach(childNode => {
			allChildNodes.push(childNode);
			allChildNodes.push(...this.getAllChildNodes(childNode));
		  });
		return allChildNodes;
	},
	//获取节点下子节点
	getChildNodes:function(node){
		const childNodes = Array.from(node.childNodes);
		return childNodes;
	},
	//清空子节点
	removeChildNodes:function(node){
		while (node.firstChild) {
		  node.removeChild(node.firstChild);
		}
	},
	init:function(id){
		this.id=id;
		const node = document.getElementById(this.id);
		const allChildNodes=this.getAllChildNodes(node);
		this.documets=allChildNodes;
		//初始化绑定事件
		this.initBind();
	},
	//初始化自动执行
	initCreated(){
		if(this.data.created){
			this.data.created()
		}
	},
	//判断是否有某个方法
	hasMethod:function(data){
		return typeof data === 'function';
	},
	//初始化数据
	importData:function(data){
		//处理data
		if(data){
			let dataObj={};
			const isdata=this.hasMethod(data.data)
			if(isdata){
				const v=data.data();
				Object.entries(v).forEach(([key, value]) => {
					dataObj[key]=value;
				});
			}
			if(data.method){
				Object.entries(data.method).forEach(([key, value]) => {
					dataObj[key]=value;
				});
			}
			const iscreated=this.hasMethod(data.created)
			if(iscreated){
				dataObj['created']=data.created;
			}
			const proxy=this.createProxyObj(dataObj,null);
			this.data=proxy;
		}
	},
	setData:function(key,value){
	  const keys = key.split('.');
	  const lastIndex = keys.length - 1;
	  keys.reduce((nestedObj, nestedKey, index) => {
	    if (index === lastIndex) {
	       nestedObj[nestedKey] = value;
	    } else {
	      if (!nestedObj.hasOwnProperty(nestedKey) || typeof nestedObj[nestedKey] !== 'object') {
	         nestedObj[nestedKey] = {};
	      }
	    }
	    return nestedObj[nestedKey];
	  }, this.data);
	},
	getData:function(key){
		if(!key){
			return null;
		}
		 const keys = key.split('.');
		  const result= keys.reduce((nestedObj, nestedKey) => {
			if (nestedObj && typeof nestedObj === 'object' && nestedKey in nestedObj) {
			  return nestedObj[nestedKey];
			}
			return undefined;
		  }, this.data);
		return result
	},
	//通知变化
	notify:function(key,attachinfo=undefined){
		console.log(key+" 发生数据变化了")
		this.notifyNodeChange(key,attachinfo);
	},
	//给数据添加观察者，用来监听数据变化
	addObserver:function(){
		this.traverseObjectProxy(this.data);
	},
	//初始化绑定事件
	initBind:function(){
		this.addObserver();
		this.documets.forEach(node=>{
			const isDOMNode = node instanceof Node;
			if(isDOMNode){
				const hasGetAttributeMethod = typeof node.getAttribute === "function"
				if(hasGetAttributeMethod){
					let nodeName=node.nodeName
					//执行条件判断
					let vif=node.getAttribute('v-if');
					if(vif){
						let keys=this.getConditionKey(vif);
						keys.forEach(e=>{
							this.dataNodeBind(e,node);
						})
					}
					//判断有无点击事件属性
					let attrValue=node.getAttribute('@click');
					if(attrValue){
						this.bindClick(node,attrValue);
					}
					//绑定括号模板输出
					const text = this.getSpecificText(node);
					let keys=this.getOutputParentheses(text);
					if(keys){
						node.setAttribute("data-reserve", text);
						keys.forEach(e=>{
							this.dataNodeBind(e,node);
						})
					}
					//绑定v-model
					let hasVmodel=node.getAttribute("v-model");
					if(hasVmodel){
						let data=app.getData(hasVmodel)
						if(data!==undefined && data!==null){
							this.bindInput(node,hasVmodel);
							this.dataNodeBind(hasVmodel,node);
						}
					}
					//绑定v-for
					let vfor=node.getAttribute('v-for');
					if(vfor){
						this.bindVfor(node,vfor);
					}
				}
				this.nodeChange(node,'init');
			}
		})
		this.initCreated();
	},
	//绑定v-for
	bindVfor:function(node,vforStr){
		// 兼容第一种 value in object
		let regex = /^\s*([^ ]+)\s+in\s+([^ ]+)$/;
		let matches= vforStr.match(regex);
		if (matches) {
			  var value = matches[1].trim();
			  var object = matches[2].trim();
			  let uuid=this.generateUUID(value);
			  node.setAttribute("data-list-obj", object);
			  node.setAttribute("data-list-key",value);
			  node.setAttribute('data-vfor-str',vforStr);
			  node.setAttribute('data-vfor-uuid',uuid);
			  
			  //绑定数据监听
			  this.dataNodeBind(object,node);
			  //绑定v-for专用子节点
			  let nodes=this.getChildNodes(node);
			  this.vfor[uuid]=nodes;
			  return;
		}
		
		//兼容第二种 (value, name) in object
		var regex2 = /\((\w+),\s*(\w+)\)\s+in\s+(\w+)/;
		var matches2 = regex2.exec(vforStr);
		
		if (matches2 !== null) {
		  var value = matches2[1];
		  var name = matches2[2];
		  var object = matches2[3];
		  let uuid=this.generateUUID(value);
		  node.setAttribute("data-list-obj", object);
		  node.setAttribute("data-list-key",value);
		  node.setAttribute("data-list-key-name",name);
		  node.setAttribute('data-vfor-str',vforStr);
		  node.setAttribute('data-vfor-uuid',uuid);
		  //绑定数据监听
		  this.dataNodeBind(object,node);
		  //绑定v-for专用子节点
		  let nodes=this.getChildNodes(node);
		  this.vfor[uuid]=nodes;
		  return;
		}
		
		//兼容第三种 (value, name, index) in object
		var regex3 = /\((\w+),\s*(\w+),\s*(\w+)\)\s+in\s+(\w+)/;
		var matches3 = regex3.exec(vforStr);
		
		if (matches3 !== null) {
		  var value = matches3[1];
		  var name = matches3[2];
		  var index = matches3[3];
		  var object = matches3[4];
		  
		  let uuid=this.generateUUID(value);
		  node.setAttribute("data-list-obj", object);
		  node.setAttribute("data-list-key",value);
		  node.setAttribute("data-list-index",index);
		  node.setAttribute("data-list-key-name",name);
		  node.setAttribute('data-vfor-str',vforStr);
		  node.setAttribute('data-vfor-uuid',uuid);
		  //绑定数据监听
		  this.dataNodeBind(object,node);
		  //绑定v-for专用子节点
		  let nodes=this.getChildNodes(node);
		  this.vfor[uuid]=nodes;
		   return;
		}
	},
	//处理v-for
	dealVfor:function(node,eventType,attachInfo=undefined){
		let key=node.getAttribute('data-list-obj');
		let objKey=node.getAttribute('data-list-key');
		let uuid=node.getAttribute('data-vfor-uuid');
		let keyName=node.getAttribute("data-list-key-name");
		let keyIndex=node.getAttribute("data-list-index");
		let childNodes;
		//获取list数据
		let listData=app.getData(key);
		if(listData){
			let isArray=Array.isArray(listData)
			let str=this.getSpecificText(node);
			if(eventType && eventType=='init'){
				//清空子节点数据
				this.removeChildNodes(node);
			}
			childNodes=this.vfor[uuid];
			let objData={};
			
			//和循环数据进行比较，相同则不更新，不相同则更新
			let index_node_list='list_'+uuid;
			//获取绑定的数据
			let nodeDataList=this.vfor[index_node_list];
			
			if(isArray){
				if(nodeDataList!==undefined){
					//先判断长度是否相等
					if(nodeDataList.length>listData.length){
						let len=nodeDataList.length-1;
						let len2=listData.length-1;
						for (var i =len; i > len2; i--) {
							let nodeData=nodeDataList[i];
							let chlds=nodeData.nodes;
							chlds.forEach(e=>{
								node.removeChild(e);
							})
							nodeDataList.splice(i, 1);
						}
					}
				}
				//遍历list数据
				for (var i = 0; i < listData.length; i++) {
					objData[objKey]=listData[i]; 
					if(keyName!== undefined && keyName!==null){
						objData[keyName]=i;
					}
					if(keyIndex!==undefined && keyIndex!==null){
						objData[keyIndex]=i;
					}
					if( eventType && eventType=='init'){
						this.initVforlist(node,childNodes,listData[i],objData,uuid,i);
					}else {
						console.log(index_node_list,eventType);
						if(nodeDataList!==undefined){
							if(nodeDataList[i]!==undefined){
								let dataNode=nodeDataList[i];
								let bindData=dataNode.bindData;
								let chlds=dataNode.nodes;
								chlds.forEach(e=>{
									if(e.nodeType === Node.TEXT_NODE){
										let str=e.textContent.trim();
										this.dealOutputParentheses(e,str,objData,node);	
									}
								})
							}else{
								//创建新的dom
								this.initVforlist(node,childNodes,listData[i],objData,uuid,i);
							}
						}else{
							//创建新的dom
							this.initVforlist(node,childNodes,listData[i],objData,uuid,i);
						}
					}
				}
			}else{
				var i=0;
				for (var keyObj in listData) {
					objData[objKey]=listData[keyObj];
					if(keyName!==undefined && keyName!==null){
						objData[keyName]=keyObj;
					}
					if(keyIndex!==undefined && keyIndex!==null){
						objData[keyIndex]=i;
					}
					childNodes.forEach(e=>{
						//深度复制节点数据
						let newNode=this.deepCloneNode(e);
						if(newNode){
							node.appendChild(newNode);
							if(newNode.nodeType === Node.TEXT_NODE){
								let str=newNode.textContent.trim();
								this.dealOutputParentheses(newNode,str,objData);	
							}
							//处理子节点的模板渲染
							app.dealChildOutputParentheses(newNode,objData)
						}
					})
				}
				i++;
			}
		}
	},
	initVforlist:function(node,childNodes,bindData,objData,uuid,index){
		let index_node_list='list_'+uuid;
		let newNodes=[];
		//初始化阶段执行
		childNodes.forEach(e=>{
			//深度复制节点数据
			let newNode=this.deepCloneNode(e);
			if(newNode){
				node.appendChild(newNode);
				if(newNode.nodeType === Node.TEXT_NODE){
					let str=newNode.textContent.trim();
					this.dealOutputParentheses(newNode,str,objData);	
				}
				newNodes.push(newNode);
				//处理子节点的渲染
				app.dealChildOutputParentheses(newNode,objData)
			}
		})
		let dataNode={};
		if(this.vfor[index_node_list]==undefined){
			this.vfor[index_node_list]=[];
		}
		dataNode.nodes=newNodes;
		dataNode.bindData=bindData;
		this.vfor[index_node_list][index]=dataNode;
	},
	//处理子节点的渲染
	dealChildOutputParentheses:function(node,objData){
		let childNodes=node.childNodes;
		if(childNodes){
			childNodes.forEach(node=>{
				if(node.nodeType === Node.TEXT_NODE){
					let str=node.textContent.trim();
					this.dealOutputParentheses(node,str,objData);	
				}
				//处理子节点的模板渲染
				app.dealChildOutputParentheses(node,objData)
			})
		}
	},
	//绑定点击事件
	bindClick:function(node,methodName){
		if(this.data[methodName]){
			//添加点击事件
			node.addEventListener('click',this.data[methodName].bind(this.data));
		}
	},
	//绑定输入事件
	bindInput:function(node,key){
		let methodName='$input_'+key.replace(/\./g,'_');
		//新建一个输入的方法
		this.data[methodName]=function(event){
			console.log('绑定输入',key)
			app.setData(key,event.target.value);
		}
		node.addEventListener('input',this.data[methodName].bind(this.data));
	},
	//深度复制
	deepCopy:function(obj){
		if (typeof obj !== 'object' || obj === null) {
			return obj;
		}
		let copy = Array.isArray(obj) ? [] : {};
		  for (let key in obj) {
			if (Object.prototype.hasOwnProperty.call(obj, key)) {
			  copy[key] = this.deepCopy(obj[key]);
			}
		  }
		  return copy;
	},
	//数据与节点进行绑定
	dataNodeBind:function(key,node){
		if(this.bindNodeData[key]){
			const index = this.bindNodeData[key].indexOf(node);
			const containsElement = index !== -1;
			if(!containsElement){
				this.bindNodeData[key].push(node);
			}
		}else{
			let arr=[];
			this.bindNodeData[key]=arr;
			this.bindNodeData[key].push(node);
		}
	},
	//通知节点重新渲染
	notifyNodeChange:function(key,eventType=undefined,attachinfo=undefined){
		let arr=this.bindNodeData[key];
	   console.log('更新绑定节点的数据',key)
		if(arr){
			arr.forEach(e=>{
				app.nodeChange(e,eventType,attachinfo)
			})
		}
	},
	//更改页面节点的信息
	nodeChange:function(node,eventType=undefined,attachinfo=undefined){
		const hasGetAttributeMethod = typeof node.getAttribute === "function"
		if(hasGetAttributeMethod){
			let vif=node.getAttribute('v-if');
			//计算v-if
			if(vif){
				let keys=this.getConditionKey(vif);
				let expressionObj={}
				expressionObj.variables={};
				//复制对象
				this.copyProperties(this.data,expressionObj.variables,keys);
				expressionObj.expression=vif;
				let result=this.ifDeal(expressionObj);
				if(!result){
					node.style.visibility='hidden';
				}else{
					node.style.visibility='visible';
				}
			}
			//处理{{}}
			let reserve=node.getAttribute('data-reserve');
			if(reserve){
				this.dealOutputParentheses(node,reserve);
			}
			//处理绑定v-model
			let vmodel=node.getAttribute('v-model');
			if(vmodel){
				node.value=app.getData(vmodel);
			}
			//处理绑定v-for 
			let vfor=node.getAttribute('v-for');
			if(vfor){
				this.dealVfor(node,eventType,attachinfo);
			}
		}
	},
	//执行括号{{}}里面的文字替换
	dealOutputParentheses:function(node,reserve,objData={},parentNode=undefined){
		if(reserve==null || reserve ==undefined){
			return ;
		}
		if(reserve.trim()==''){
			return;
		}
		//节点的文字内容
		let keys=this.getOutputParentheses(reserve);
		if(keys){
			keys.forEach(e=>{
				let value=app.getData(e);
				if(value!==undefined && value!==null){
					objData[e]=value;
				}else{
					value=app.getNestedValue(objData,e);
					if(value!==null && value!==undefined){
						objData[e]=value;
					}
				}
			})
			let newValue=this.replacePlaceholders(reserve,objData);
			if(this.isTextNode(node)){
				// 创建一个新的文本节点
				var newTextNode = document.createTextNode(newValue);
				if(node.parentNode!==null){
					// 替换原有的文本节点
					node.parentNode.replaceChild(newTextNode, node);
				}
				
			}else{
				node.innerText=newValue;
			}
		}
	},
	//处理v-if里面的表达示
	ifDeal:function(expressionObj){
		const { variables, expression } = expressionObj;
		for (let variable in variables) {
			 const keys = variable.split('.');
			 if(keys.length>1){
				 let key=keys[0];
				 eval(`var ${key} = {};`);
				 let str=key;
				 for (var i = 1; i < keys.length; i++) {
				 	 str=str+'.'+keys[i];
					 eval(`${str} = {};`);
				 }
			 }
			let v=variables[variable]
			let result1= eval(`${variable} = ${v};`);
		}
		try {
		  const result = eval(expression);
		  return result;
		} catch (error) {
		  console.error("Error evaluating expression:", error);
		  return undefined;
		}
		return false;
	},
	//复制对象
	copyProperties:function(source, target, properties){
		  for (let prop of properties) {
		       const propParts = prop.split('.');
		       let sourceValue = source;
		       for (let part of propParts) {
					 if (sourceValue.hasOwnProperty(part)) {
					   sourceValue = sourceValue[part];
					 } else {
					   sourceValue = undefined;
					   break;
					 }
		       }
		       if (sourceValue !== undefined) {
		         target[prop] = sourceValue;
		       }
		 }
	},
	//获取v-if条件用到的key
	getConditionKey:function(obj){
		if(obj){
			const keys = obj.match(/[a-zA-Z_][a-zA-Z0-9_.]*/g);
			return keys;
		}
	},
	//获取输出括号里面的值
	getOutputParentheses:function(obj){
		// 使用正则表达式提取 {{ key }} 中的 key 值
		const regex = /{{\s*([^}]+)\s*}}/g;
		const matches = obj.match(regex);
		if (matches) {
			const values = matches.map(match => match.match(/{{\s*([^}]+)\s*}}/)[1].trim());
			return values;
		}
		return null;
	},
	//替换{{}} 里面的内容，目前已废弃
	replaceOutputParenthesesValue(value,replaceValue){
		const result = value.replace(/{{\s*(\w+(\.\w+)*)\s*}}/g,replaceValue);
		return result;
	},
	//创建对象代理
	createProxyObj:function(obj,key){
		let handler=this.getObjectHandler(key);
		const proxyObj = new Proxy(obj,handler);
		return proxyObj;
	},
	//创建数组代理
	createProxyArray:function(array,key){
		const arrayHandler=this.getArrayHandler(key);
		const proxyArray = new Proxy(array, arrayHandler);
		return proxyArray;
	},
	//监听数组变化代理拦截对象
	getArrayHandler:function(key){
		const arrayHandler = {
		  get(target, property) {
		    if (property === 'push' || property === 'pop' || property === 'splice') {
		      return function(...args) {
		        const result = Array.prototype[property].apply(target, args);
		        console.log(key+'数组发生变化:', property, args);
				let key_;
				if(property === 'push' || property === 'pop' || property === 'splice'){
					key_=key;
				}else if(key){
					key_=key+'.'+property;
				}else{
					key_=property
				}
				app.notifyNodeChange(key_)
		      };
		    } else {
		       return Reflect.get(target, property);
		    }
		  },
		  set(target, property, value) {
		    if (typeof property === 'number') {
		      console.log('修改索引', property, '为:', value);
		    }
		    return Reflect.set(target, property, value);
		  }
		};
		return arrayHandler;
	},
	//监听对象变化代理拦截对象
	getObjectHandler:function(key){
		const handler = {
		  set(target, prop, value, receiver) {
			Reflect.set(target, prop, value, receiver);
		    // 执行自定义操作
		    console.log(key+'对象已发生变化：', target,prop);
			let key_;
			if(key){
				key_=key+'.'+prop;
			}else{
				key_=prop;
			}
			app.notifyNodeChange(key_);
		  },
		};
		return handler;
	},
	getProxyHandlerArray:function(key){
		const handler = {
		  set: function(target, index, value) {
		    // 监听数组元素的修改
		    Reflect.set(target, key, value);
			console.log(`修改了下标为 ${key} 的元素，新值为 ${value}`);
		  },
		  deleteProperty: function(target, index) {
		    // 监听数组元素的删除
		    console.log(`删除了下标为 ${index} 的元素`);
		    return Reflect.deleteProperty(target, index);
		  },
		  apply: function(target, thisArg, args) {
		    // 监听数组的方法调用（如push、pop等），用以获取新增元素的下标
		    if (args[0] === 'push') {
		      const newElements = args[1];
		      console.log(`新增了 ${newElements.length} 个元素到数组，起始下标为 ${target.length}`);
		    }
		    return Reflect.apply(target, thisArg, args);
		  }
		};
		return handler;
	},
	//获取节点下没有被标签包裹的文字
	getSpecificText:function(dom){
	  let textContent = "";
	  for (let node of dom.childNodes) {
		if (node.nodeType === Node.TEXT_NODE) {
		  textContent += node.textContent.trim();
		}
	  }
	  return textContent;
	},
	//深度复制某个节点
	deepCloneNode:function(node){
	 if (node.nodeType === Node.ELEMENT_NODE) {
		var clone = document.createElement(node.nodeName);
		
		// 复制节点的属性
		for (var i = 0; i < node.attributes.length; i++) {
		  var attribute = node.attributes[i];
		  for(const key  in attribute ){
			  console.log(key,attribute[key])
		  }
		  
		  clone.setAttribute(attribute.node, attribute.nodeValue);
		}
		
		// 递归复制子节点
		for (var i = 0; i < node.childNodes.length; i++) {
		  var child = node.childNodes[i];
		  clone.appendChild(app.deepCloneNode(child));
		}
		
		return clone;
	  } else if (node.nodeType === Node.TEXT_NODE) {
		return document.createTextNode(node.nodeValue);
	  } else if (node.nodeType === Node.COMMENT_NODE) {
		return document.createComment(node.nodeValue);
	  } else {
		return null;
	  }
	},
	//生成uuid
	generateUUID:function(str){
		 var d = new Date().getTime();
		  var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
		    var r = (d + Math.random() * 16) % 16 | 0;
		    d = Math.floor(d / 16);
		    return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
		  });
		  return str+'_'+uuid;
	},
	//替换{{}} 里面的值
	replacePlaceholders: function(str, data) {
	  let str_= str.replace(/{{\s*(\w+(\.\w+)*)\s*}}/g, function(match, p1) {
	     if (typeof data[p1] === 'undefined' || data[p1] === "undefined") {
	        return match;  // 返回原始的匹配内容
	      } else {
	        return data[p1];  // 返回对应的值
	      }
	  });
	  return str_;
	},
	//判断是否是文本节点
	isTextNode:function(node){
		return node.nodeType === Node.TEXT_NODE
	},
	//使用类似 form.name 去对象里面取值(重要)
	getNestedValue:function(obj,key){
		var keys = key.split(".");
		var value = obj;
		for (var i = 0; i < keys.length; i++) {
		  if (value && typeof value === "object" && keys[i] in value) {
		    value = value[keys[i]];  // 更新当前值
		  } else {
		    return undefined;  // 如果属性不存在，则返回 undefined
		  }
		}
		return value;
	},
	//深度复制对象
	traverseObjectProxy:function(obj,parentKey = ''){
		for (var key in obj) {
		   var currentKey = parentKey ? parentKey + '.' + key : key; // 记录当前键的层级
		   if (Array.isArray(obj[key])) { // 检查是否为数组
		     console.log("数组：" + currentKey);
			 //数组添加代理
			 const proxyArray=this.createProxyArray(obj[key],currentKey);
			 app.setValueByPath(this.data,currentKey,proxyArray);
		     obj[key].forEach(function(element) {
		       if (typeof element === 'object') { // 检查是否为对象
		         app.traverseObjectProxy(element, currentKey); // 递归遍历子对象
		       }
		     });
		   } else if (typeof obj[key] === 'object') { // 检查是否为对象
		    //对象添加代理
		     console.log("对象：" + currentKey);
			 const proxy=this.createProxyObj(obj[key],currentKey);
			  app.setValueByPath(this.data,currentKey,proxy);
		     app.traverseObjectProxy(obj[key], currentKey); // 递归遍历子对象
		   }
		 }
	},
	//保存数据 通过form.name 来设置姓名
	setValueByPath:function(obj, path, value){
		var keys = path.split('.'); // 将路径字符串分割成键的数组
		var currentObj = obj;
		for (var i = 0; i < keys.length - 1; i++) {
		  var key = keys[i];
		  if (!currentObj[key]) {
		    currentObj[key] = {}; // 如果路径上的某个键不存在，则创建一个空对象
		  }
		  currentObj = currentObj[key]; // 更新当前对象
		}
		var lastKey = keys[keys.length - 1];
		currentObj[lastKey] = value; // 给最后一个键设置值
	},
	createModel(dom){
		let domModel={};
		if (dom instanceof Element) {
			domModel.type='element';
			domModel.model=dom;
		}else{
			if (node.nodeType === 3){
				let textContent=node.textContent
				if (/^\s*$/.test(textContent) === false) {
					let parent=dom.parentNode;
					domModel.type='text';
					domModel.parent=parent;
					domModel.model=dom;
					domModel.text=textContent;
				}
			}
		}
		return domModel;
	},
	//创建虚拟文本dom
	createTextDom(text){
		var newTextDom = document.createTextNode(text);
		return newTextDom;
	},
	//递归调用node的数据列表
	recursiveProcessNode(node,callback){
		if (!node.children || node.children.length === 0) {
		    return;
		}
		if (node instanceof Element) {
			const childNodes = Array.from(node.childNodes);
			childNodes.forEach(childNode => {
				callback(childNode);
				this.getAllChildNodes(childNode);
			});	
		}
	}
	//递归调用dataList 数据列表   childField 子属性 parentData 副属性  callback 回调函数
	recursiveProcess(dataList, childField, parentData, callback) {
	  // 遍历数据列表
	  dataList.forEach(data => {
	    // 执行回调函数，并传递当前数据对象和父数据对象
	    callback(data, parentData);
	    // 检查是否存在child字段且具有数据
	    if (data[childField] && data[childField].length > 0) {
	      // 递归调用自身处理子级数据，将当前数据对象作为父数据对象传递
	      recursiveProcess(data[childField], childField, data, callback);
	    }
	  });
	}
}